import request from '@/utils/request'
import { parse } from 'flatted'
import qs from 'qs'


export function fetchList(query) {
    return request({
        url: '/slide',
        method: 'get',
        params: query
    })
}

export function fetchArticle(id) {
    return request({
        url: `/slide/${id}`,
        method: 'get',
    })
}

export function removeBanner(id) {
    return request({
        url: `/slide/${id}`,
        method: 'delete',
    })
}

export function createArticle(data) {
    return request({
        url: '/slide/create',
        method: 'get',
        params: data
    })
}

export function updateArticle(data) {
    return request({
        url: `/slide/${data.id}`,
        method: 'put',
        params: data
    })
}

export function getBannerTotal() {
    return request({
        url: '/getAllTableNumbers',
        method: 'get',
        params: { table_name: 'bananer' }
    })
}